package com.jboltai.capability.text;

import com.jboltai.event.text.ContentSourceType;

import java.io.File;
import java.util.List;

public class TextSplitResult {

    /**
     * 资源类型，本地文件，线上文件，网页
     */
    private ContentSourceType contentSourceType;
    /**
     * 标题
     */
    private String title;

    /**
     * 来源url，只有resourceType是线上文件和网页时可获取该属性值
     */
    private String sourceUrl;

    /**
     * 来源文件，只有resourceType是本地文件时，可获取该属性值
     */
    private File sourceFile;

    /**
     * 内容
     */
    private List<String> chuncks;

    public TextSplitResult(TextExtractResult extractResult) {
        if (extractResult != null) {
            this.contentSourceType = extractResult.getContentSourceType();
            this.title = extractResult.getTitle();
            this.sourceFile = extractResult.getSourceFile();
            this.sourceUrl = extractResult.getSourceUrl();
        }
    }

    public TextSplitResult(ContentSourceType contentSourceType) {
        this.contentSourceType = contentSourceType;
    }




    public String getTitle() {
        return title;
    }

    public TextSplitResult setTitle(String title) {
        this.title = title;
        return this;
    }

    public List<String> getChuncks() {
        return chuncks;
    }

    public TextSplitResult setChuncks(List<String> chuncks) {
        this.chuncks = chuncks;
        return this;
    }

    public String getSourceUrl() {
        return sourceUrl;
    }

    public TextSplitResult setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
        return this;
    }

    public File getSourceFile() {
        return sourceFile;
    }

    public TextSplitResult setSourceFile(File sourceFile) {
        this.sourceFile = sourceFile;
        return this;
    }

    public ContentSourceType getContentSourceType() {
        return contentSourceType;
    }

    public TextSplitResult setContentSourceType(ContentSourceType contentSourceType) {
        this.contentSourceType = contentSourceType;
        return this;
    }
}
